﻿using Daemon.Model;
using Microsoft.AspNetCore.Mvc;
using Daemon.Repository.Contract;
using System.Net;
using System.Net.Http;
using Microsoft.AspNetCore.Http;
using Daemon.Common;

namespace DaemonAPI
{
	[ApiController]
	[Route("api/[controller]/[action]")]
	public class TakeAwayUserAddressController : BaseApiController<TakeAwayUserAddress, ITakeAwayUserAddressRepository>
	{
		public TakeAwayUserAddressController(ITakeAwayUserAddressRepository repository, IHttpContextAccessor httpContextAccessor) : base(repository, httpContextAccessor)
		{
		}

		[Route("")]
		[HttpGet]
		public ResultModel<TakeAwayUserAddress, ITakeAwayUserAddressRepository> GetUserAddressByUserId(int? shopId, int userId)
		{
			return new ResultModel<TakeAwayUserAddress, ITakeAwayUserAddressRepository>(HttpStatusCode.OK, null, _repository.GetUserAddressByUserId(shopId, userId));
		}
	}
}
